﻿//
// (C) Copyright 2009 Irantha Suwandarathna (iranthas@hotmail.com)
//

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EffiProz.Core;

namespace EffiProz.Explorer
{
    class SqlSyntaxProvider
    {
        static List<string> tags = new List<string>();
        static List<char> specials = new List<char>();
      
        static SqlSyntaxProvider()
        {
          
            tags = Tokens.GetReservedWords();
           

            char[] chrs = {
                '.',
                ')',
                '(',
                '[',
                ']',
                '>',
                '<',
                ':',
                ';',
                '\n',
                '\t'
            };
            specials = new List<char>(chrs);
        }
       
        public static List<char> GetSpecials
        {
            get { return specials; }
        }
        public static List<string> GetTags
        {
            get { return tags; }
        }
        public static bool IsKnownTag(string tag)
        {
            return tags.Exists(delegate(string s) { return s.ToLower().Equals(tag.ToLower()); });
        }
        public static List<string> GetJSProvider(string tag)
        {
            return tags.FindAll(delegate(string s) { return s.ToLower().StartsWith(tag.ToLower()); });
        }
    }
}
